package BC90_矩阵计算;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int sum = 0;
        for (int i = 0; i < n * m; i++){
            int s = sc.nextInt();
            if (s > 0){
                sum += s;
            }
        }
        System.out.println(sum);
    }
}
